package com.candy.IO;

import java.io.File;
import java.io.FilenameFilter;

/**
 * @author donglin
 * @Title:
 * @类名: Test05
 * @date 2020/7/20
 */
public class Test05 {
    public static void main(String[] args) {
        File ff=new File("E:\\学习相关\\学习视频\\内师大直播视频\\java基础串讲\\0717");
        String[] strFileName= ff.list(new FilenameFilter() {
            @Override
            public boolean accept(File dir, String name) {
                if(name.endsWith(".txt")){
                    return true;
                }else {
                    return false;
                }
            }
        });
        for (String sf:strFileName
             ) {
            System.out.println(sf);
        }


    }
}


